package com.hdax.dmw.scheduler.api;

import com.hdax.dmw.common.utils.Result;
import com.hdax.dmw.scheduler.dtos.TimePlanDto;
import com.hdax.dmw.scheduler.service.SchedulerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(path = "/desc")
public class TimePlanApi {

    @Autowired
    private SchedulerService schedulerService;

    @PostMapping(path = "/getTimePlan")
    public Result<List<TimePlanDto>> getTimePlan(@RequestBody Map<String,Long> params){
        Long itemId = params.get("itemId");
        return schedulerService.getTimePlan(itemId);
    }
}
